package com.org.context;

public class BaseContext {

    public static ThreadLocal<Long> threadLocalUserId = new ThreadLocal<>();

    public static ThreadLocal<String> threadLocalToken = new ThreadLocal<>();

    public static void setCurrentId(Long id) {
        threadLocalUserId.set(id);
    }

    public static void setThreadLocalToken(String token) {
        threadLocalToken.set(token);
    }

    public static Long getCurrentId() {
        return threadLocalUserId.get();
    }

    public static String getThreadLocalToken() {
        return threadLocalToken.get();
    }

    public static void removeCurrentId() {
        threadLocalUserId.remove();
        threadLocalToken.remove();
    }

}
